package com.eryos.android.holidaybudget.ui;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.eryos.android.holidaybudget.R;
import com.eryos.android.holidaybudget.RootActivity.VIEW;

/**
 * Project :  Holiday'sBudget
 * Author :   Olivier Combe 
 * URL :      http://eryos.fr/Holiday'sBudget/
 *
 * Copyright (C) 2011 - Olivier Combe 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 *
 */

public class TopBanner extends LinearLayout {
	
	ImageView backButton;
	TextView titleField;
	ImageView waitPicture;

	private String LOG_TAG = "TopBanner";
	private boolean hasBackButton = true;

	public TopBanner(Context context, boolean hasButton, String title) {
		super(context);
		Log.d(LOG_TAG, "Init Top Banner");
		
		hasBackButton = hasButton;

		LayoutInflater li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		li.inflate(R.layout.topbanner, this, true);

	 	backButton 	= (ImageView) findViewById(R.id.banner_back_picture);
	 	titleField 	= (TextView)  findViewById(R.id.banner_title);
	 	waitPicture = (ImageView) findViewById(R.id.banner_wait_picture);

	 	if ( ! hasBackButton )
	 		backButton.setVisibility(INVISIBLE);

	 	setTitle(title);
	}
	
	public void setTitle(String title){
		Log.d(LOG_TAG, "TopBanner title : "+title);
		titleField.setText(title);
	}
	
	private void initHandlers(){

	}
	
}
